/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package gui;



import java.util.ArrayList;
import java.util.List;
import javax.swing.ButtonGroup;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import modelo.FacturasTableModel;
import persistencia.ClientesDAO;
import persistencia.FacturasDAO;
import pojos.Cliente;
import pojos.Facturas;




/**
 *
 * @author alejandrolopezdelolmo
 */
public class PanelFacturas extends javax.swing.JPanel {

    JFrame panelPadre;
    FacturasDAO gesFacturas;
    ClientesDAO gesClientes;
    FacturasTableModel modeloTablaFacturas;
    List<String> nombreColumnas;
  
    public PanelFacturas(JFrame ventanaPadre) {
        initComponents();
        ButtonGroup bg = new ButtonGroup();
        bg.add(jCheckBoxCodigoFactura);
        bg.add(jCheckBoxCodigoAlbaran);
        bg.add(jCheckBoxIdCliente);
        bg.add(jCheckBoxImporte);
        gesFacturas=new FacturasDAO();
        gesClientes=new ClientesDAO();
        nombreColumnas=new ArrayList();
        nombreColumnas.add("CodFacturas");
        nombreColumnas.add("CodAlbarán");
        nombreColumnas.add("IdCliente");
        nombreColumnas.add("Importe Total");
        modeloTablaFacturas=new FacturasTableModel(gesFacturas.getFacturas(), nombreColumnas);
        jTableConsultaFacturas.setModel(modeloTablaFacturas);
        
        
           
        
    }
    public void cargarDatosTabla(){
        modeloTablaFacturas=new FacturasTableModel(gesFacturas.getFacturas(), nombreColumnas);
        jTableConsultaFacturas.setModel(modeloTablaFacturas);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jToolBar1 = new javax.swing.JToolBar();
        jButtonAddNuevaFactura = new javax.swing.JButton();
        jButtonModificarFactura = new javax.swing.JButton();
        jButtonEliminarFactura = new javax.swing.JButton();
        jScrollPaneTablasFacturas = new javax.swing.JScrollPane();
        jTableConsultaFacturas = new javax.swing.JTable();
        jLabelFacturaPFactura = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTextFieldCodigoFactura = new javax.swing.JTextField();
        jTextFieldCodigoAlbaran = new javax.swing.JTextField();
        jTextFieldIdCliente = new javax.swing.JTextField();
        jSliderImporte = new javax.swing.JSlider();
        jButtonBuscarFactura = new javax.swing.JButton();
        jCheckBoxCodigoFactura = new javax.swing.JRadioButton();
        jCheckBoxCodigoAlbaran = new javax.swing.JRadioButton();
        jCheckBoxIdCliente = new javax.swing.JRadioButton();
        jCheckBoxImporte = new javax.swing.JRadioButton();

        addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusLost(java.awt.event.FocusEvent evt) {
                formFocusLost(evt);
            }
        });

        jToolBar1.setFloatable(false);
        jToolBar1.setRollover(true);

        jButtonAddNuevaFactura.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconos/ico_plus.png"))); // NOI18N
        jButtonAddNuevaFactura.setToolTipText("Nueva factura");
        jButtonAddNuevaFactura.setFocusable(false);
        jButtonAddNuevaFactura.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonAddNuevaFactura.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButtonAddNuevaFactura.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonAddNuevaFacturaActionPerformed(evt);
            }
        });
        jToolBar1.add(jButtonAddNuevaFactura);

        jButtonModificarFactura.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconos/ico_edit2.png"))); // NOI18N
        jButtonModificarFactura.setToolTipText("Modificar factura");
        jButtonModificarFactura.setFocusable(false);
        jButtonModificarFactura.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonModificarFactura.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButtonModificarFactura.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonModificarFacturaActionPerformed(evt);
            }
        });
        jToolBar1.add(jButtonModificarFactura);

        jButtonEliminarFactura.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconos/ico_bin.png"))); // NOI18N
        jButtonEliminarFactura.setToolTipText("Eliminar factura");
        jButtonEliminarFactura.setFocusable(false);
        jButtonEliminarFactura.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonEliminarFactura.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButtonEliminarFactura.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonEliminarFacturaActionPerformed(evt);
            }
        });
        jToolBar1.add(jButtonEliminarFactura);

        jTableConsultaFacturas.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {"00001", "142243", "021215", "1.0262"},
                {"00002", "142433", "045465", "2.1262"},
                {"00003", "453453", "054664", "5.4122"},
                {"00004", "456465", "054553", null}
            },
            new String [] {
                "CodFactura", "CodAlbaran", "IdCliente", "ImporteTotal"
            }
        ));
        jScrollPaneTablasFacturas.setViewportView(jTableConsultaFacturas);

        jLabelFacturaPFactura.setFont(new java.awt.Font("Tahoma", 1, 24)); // NOI18N
        jLabelFacturaPFactura.setText("FACTURA");

        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());

        jLabel1.setText("Filtos de búsqueda");

        jTextFieldCodigoFactura.setEnabled(false);

        jTextFieldCodigoAlbaran.setEnabled(false);

        jTextFieldIdCliente.setEnabled(false);

        jSliderImporte.setEnabled(false);

        jButtonBuscarFactura.setIcon(new javax.swing.ImageIcon(getClass().getResource("/iconos/ico_find.png"))); // NOI18N
        jButtonBuscarFactura.setToolTipText("Buscar factura");
        jButtonBuscarFactura.setFocusable(false);
        jButtonBuscarFactura.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jButtonBuscarFactura.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        jButtonBuscarFactura.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButtonBuscarFacturaMouseClicked(evt);
            }
        });

        jCheckBoxCodigoFactura.setText("Código factura");
        jCheckBoxCodigoFactura.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jCheckBoxCodigoFacturaMouseClicked(evt);
            }
        });

        jCheckBoxCodigoAlbaran.setText("Código albarán");
        jCheckBoxCodigoAlbaran.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jCheckBoxCodigoAlbaranMouseClicked(evt);
            }
        });

        jCheckBoxIdCliente.setText("Id Cliente");
        jCheckBoxIdCliente.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jCheckBoxIdClienteMouseClicked(evt);
            }
        });

        jCheckBoxImporte.setText("Importe");
        jCheckBoxImporte.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jCheckBoxImporteMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jCheckBoxCodigoFactura)
                            .addComponent(jCheckBoxCodigoAlbaran)
                            .addComponent(jCheckBoxIdCliente)
                            .addComponent(jCheckBoxImporte))
                        .addGap(154, 154, 154)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jTextFieldCodigoFactura)
                                .addComponent(jTextFieldCodigoAlbaran)
                                .addComponent(jTextFieldIdCliente, javax.swing.GroupLayout.DEFAULT_SIZE, 145, Short.MAX_VALUE))
                            .addGroup(jPanel1Layout.createSequentialGroup()
                                .addComponent(jSliderImporte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 90, Short.MAX_VALUE)
                                .addComponent(jButtonBuscarFactura, javax.swing.GroupLayout.PREFERRED_SIZE, 138, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addGap(19, 19, 19))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                        .addComponent(jSliderImporte, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGroup(jPanel1Layout.createSequentialGroup()
                            .addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextFieldCodigoFactura, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jCheckBoxCodigoFactura))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextFieldCodigoAlbaran, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jCheckBoxCodigoAlbaran))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jTextFieldIdCliente, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jCheckBoxIdCliente))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addComponent(jCheckBoxImporte)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(114, 114, 114)
                        .addComponent(jButtonBuscarFactura, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(13, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(68, 68, 68)
                .addComponent(jLabelFacturaPFactura)
                .addGap(0, 433, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPaneTablasFacturas, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 712, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelFacturaPFactura))
                .addGap(18, 18, 18)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jScrollPaneTablasFacturas, javax.swing.GroupLayout.PREFERRED_SIZE, 279, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(67, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jButtonAddNuevaFacturaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddNuevaFacturaActionPerformed
        JDialogAddFactura nuevaFactura=new JDialogAddFactura(panelPadre, true);
        nuevaFactura.setVisible(true);
    }//GEN-LAST:event_jButtonAddNuevaFacturaActionPerformed

    private void jButtonEliminarFacturaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonEliminarFacturaActionPerformed
        int opcion;
        String[] opciones = {"Aceptar","Cancelar"};
        opcion=JOptionPane.showOptionDialog(this, "¿Seguro que quieres borrar la factura seleccionada?", "Información",JOptionPane.DEFAULT_OPTION,JOptionPane.WARNING_MESSAGE,null,opciones,"Cancelar");
        if (opcion == 0) {
            
            
                int filas=jTableConsultaFacturas.getSelectedRow();
                int columnas = 0;
                String idFactura=jTableConsultaFacturas.getValueAt(filas, columnas).toString();
                gesFacturas.deleteFactura(idFactura);
          
                JOptionPane.showMessageDialog(this, "La factura ha sido borrada", "Información", JOptionPane.INFORMATION_MESSAGE);
        }else{
                JOptionPane.showMessageDialog(this, "No se ha borrado la factura", "Información", JOptionPane.INFORMATION_MESSAGE);
        }
        
    }//GEN-LAST:event_jButtonEliminarFacturaActionPerformed

    private void jButtonModificarFacturaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModificarFacturaActionPerformed
        
        int filas=jTableConsultaFacturas.getSelectedRow();
        
//        for (int columnas = 0; columnas < nombreColumnas.size(); columnas++) {
//            factura.add(jTableConsultaFacturas.getValueAt(filas, columnas).toString());
//        }
//        String idCliente=factura.get(2);
//        Cliente cliente=gesClientes.getCliente(idCliente);
////        necesito obtener un cliente por idCliente
//        int importeTotal=Integer.parseInt(factura.get(3));
//        
//        Facturas facturaAModificar=new Facturas(null, cliente, importeTotal);
        
        int columnas = 0;
        String idFactura=jTableConsultaFacturas.getValueAt(filas, columnas).toString();
        Facturas factura=gesFacturas.getFacturaPorId(idFactura);
        
        JDialogUpdateFactura editarFactura=new JDialogUpdateFactura(panelPadre, true,factura);
        editarFactura.setVisible(true);
        
        
    }//GEN-LAST:event_jButtonModificarFacturaActionPerformed

    private void jButtonBuscarFacturaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButtonBuscarFacturaMouseClicked
        String codFactura=null;
        String codAlbaran=null;
        String idCliente=null;
        String importe=null;
        
        if (jCheckBoxCodigoFactura.isSelected()) {
            try{
                //BUSQUEDA POR ID
                codFactura=jTextFieldCodigoFactura.getText();
                if (gesFacturas.getFacturasPorId(codFactura)!=null) {
                    
                    modeloTablaFacturas=new FacturasTableModel(gesFacturas.getFacturasPorId(codFactura), nombreColumnas);
                    jTableConsultaFacturas.setModel(modeloTablaFacturas);
                }
                               
            }catch(Exception ex){
                JOptionPane.showMessageDialog(this, "Valor inválido", "Error", JOptionPane.ERROR_MESSAGE);
            }
            
        }//if
        
        if (jCheckBoxCodigoAlbaran.isSelected()) {
            try{
                //BUSQUEDA ALBARAN
                codAlbaran=jTextFieldCodigoAlbaran.getText();
                if (gesFacturas.getFacturasPorAlbaran(codAlbaran)!=null) {
                    
                    modeloTablaFacturas=new FacturasTableModel(gesFacturas.getFacturasPorAlbaran(codAlbaran), nombreColumnas);
                    jTableConsultaFacturas.setModel(modeloTablaFacturas);
                }
                               
            }catch(Exception ex){
                JOptionPane.showMessageDialog(this, "Valor inválido", "Error", JOptionPane.ERROR_MESSAGE);
            }
            
        }//if
        
        if (jCheckBoxIdCliente.isSelected()) {
            try{
                //BUSQUEDA POR ID CLIENTE
                idCliente=jTextFieldIdCliente.getText();
                if (gesFacturas.getFacturasPorCliente(idCliente)!=null) {
                    
                    modeloTablaFacturas=new FacturasTableModel(gesFacturas.getFacturasPorCliente(idCliente), nombreColumnas);
                    jTableConsultaFacturas.setModel(modeloTablaFacturas);
                }
                               
            }catch(Exception ex){
                JOptionPane.showMessageDialog(this, "Valor inválido", "Error", JOptionPane.ERROR_MESSAGE);
            }
            
        }//if
        
        if (jCheckBoxImporte.isSelected()) {
            try{
                //BUSQUEDA POR IMPORTE
                importe=""+jSliderImporte.getValue();
                if (gesFacturas.getFacturasPorImporte(importe)!=null) {
                    
                    modeloTablaFacturas=new FacturasTableModel(gesFacturas.getFacturasPorImporte(importe), nombreColumnas);
                    jTableConsultaFacturas.setModel(modeloTablaFacturas);
                }
                               
            }catch(Exception ex){
                JOptionPane.showMessageDialog(this, "Valor inválido", "Error", JOptionPane.ERROR_MESSAGE);
            }
            
        }//if
        
        if (!jCheckBoxImporte.isSelected()&&!jCheckBoxIdCliente.isSelected()&&!jCheckBoxCodigoAlbaran.isSelected()&&!jCheckBoxCodigoFactura.isSelected()) {
            cargarDatosTabla();
        }
    }//GEN-LAST:event_jButtonBuscarFacturaMouseClicked

    private void jCheckBoxCodigoFacturaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jCheckBoxCodigoFacturaMouseClicked
         if (jCheckBoxCodigoFactura.isSelected()) {
            jTextFieldCodigoFactura.setEnabled(true);
            jTextFieldCodigoAlbaran.setEnabled(false);
            jTextFieldIdCliente.setEnabled(false);
            jSliderImporte.setEnabled(false);
        }//if
    }//GEN-LAST:event_jCheckBoxCodigoFacturaMouseClicked

    private void jCheckBoxCodigoAlbaranMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jCheckBoxCodigoAlbaranMouseClicked
         if (jCheckBoxCodigoAlbaran.isSelected()) {
            jTextFieldCodigoFactura.setEnabled(false);
            jTextFieldCodigoAlbaran.setEnabled(true);
            jTextFieldIdCliente.setEnabled(false);
            jSliderImporte.setEnabled(false);
        }//if
    }//GEN-LAST:event_jCheckBoxCodigoAlbaranMouseClicked

    private void jCheckBoxIdClienteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jCheckBoxIdClienteMouseClicked
        if (jCheckBoxIdCliente.isSelected()) {
            jTextFieldCodigoFactura.setEnabled(false);
            jTextFieldCodigoAlbaran.setEnabled(false);
            jTextFieldIdCliente.setEnabled(true);
            jSliderImporte.setEnabled(false);
        }//if
    }//GEN-LAST:event_jCheckBoxIdClienteMouseClicked

    private void jCheckBoxImporteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jCheckBoxImporteMouseClicked
           if (jCheckBoxImporte.isSelected()) {
            jTextFieldCodigoFactura.setEnabled(false);
            jTextFieldCodigoAlbaran.setEnabled(false);
            jTextFieldIdCliente.setEnabled(false);
            jSliderImporte.setEnabled(true);
        }//if
    }//GEN-LAST:event_jCheckBoxImporteMouseClicked

    private void formFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_formFocusLost
        jCheckBoxCodigoFactura.setSelected(false);
        jCheckBoxCodigoAlbaran.setSelected(false);
        jCheckBoxIdCliente.setSelected(false);
        jCheckBoxImporte.setSelected(false);
        jTextFieldCodigoFactura.setEnabled(false);
        jTextFieldCodigoAlbaran.setEnabled(false);
        jTextFieldIdCliente.setEnabled(false);
        jSliderImporte.setEnabled(false);
        
    }//GEN-LAST:event_formFocusLost

   
  
    
     
     

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButtonAddNuevaFactura;
    private javax.swing.JButton jButtonBuscarFactura;
    private javax.swing.JButton jButtonEliminarFactura;
    private javax.swing.JButton jButtonModificarFactura;
    private javax.swing.JRadioButton jCheckBoxCodigoAlbaran;
    private javax.swing.JRadioButton jCheckBoxCodigoFactura;
    private javax.swing.JRadioButton jCheckBoxIdCliente;
    private javax.swing.JRadioButton jCheckBoxImporte;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabelFacturaPFactura;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPaneTablasFacturas;
    private javax.swing.JSlider jSliderImporte;
    public javax.swing.JTable jTableConsultaFacturas;
    private javax.swing.JTextField jTextFieldCodigoAlbaran;
    private javax.swing.JTextField jTextFieldCodigoFactura;
    private javax.swing.JTextField jTextFieldIdCliente;
    private javax.swing.JToolBar jToolBar1;
    // End of variables declaration//GEN-END:variables
}
